#!/usr/bin/python3
# -*- coding: utf-8 -*-
# <bitbar.title>My Baby Time</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>suweijie</bitbar.author>
# <bitbar.author.github>sueflybaby</bitbar.author.github>
# <bitbar.desc>show the left time about bb to birth</bitbar.desc>
import time
nowtime = time.time()
#firstdayArray 为孕妇末次月经时间 2019-12-11 日
firtdayArray = (2019,12,11,00,00,00,0,0,0)
firtdayArrayToTime = time.mktime(firtdayArray)
intervalTime = nowtime-firtdayArrayToTime
#计算差值秒数变为天
result_days = int(intervalTime/3600/24)
result_moon = intervalTime/3600/24/28
result_week = int(intervalTime/3600/24/7)
result_percent = result_week/40*100
print ("宝宝%s/280天，%.1f%%。" % (result_days,result_percent))
print ("---")
print (str(result_days) + "天")
print (str(result_week) + "周")
print (str("%.1f" % result_moon) + "月")
print ("宝宝进度 " + str("%0.1f" % result_percent)+ "%")
